import i18n from '@src/locales'

/* 工单指派 通用表格列 */
export const TaskAllotUserTableCommonColumns = [
  {
    "label": "",
    "field": "userId",
    "show": true,
    "fixed": true,
    "width": "50px",
    "type": "column",
    "disabled": true
  },
  {
    "label": i18n.t('common.form.type.serviceProviderName') as string,
    "field": "serviceProviderName",
    "show": true,
    "fixed": false,
    "width": "150px",
    "type": "column"
  },
  {
    "label": i18n.t('task.components.displayName.engineer') as string,
    "field": "username",
    "show": true,
    "fixed": false,
    "width": "150px",
    "type": "column",
  },
  {
    "label": i18n.t('common.label.subCertifications') as string,
    "field": "qualificationNames",
    "show": true,
    "fixed": false,
    "width": "150px",
    "type": "column",
  },
  {
    "label": i18n.t('task.components.displayName.distance'),
    "field": "distance",
    "show": true,
    "fixed": false,
    "sortable": 'custom',
    "width": "100px",
    "type": "column"
  },
  {
    "label": i18n.t('task.unfinishedTask') as string,
    "field": "ufinish",
    "show": true,
    "fixed": false,
    "sortable": 'custom',
    "width": "150px",
    "type": "column"
  },
  {
    "label": i18n.t('task.components.displayName.todayFinished') as string,
    "field": "finish",
    "show": true,
    "fixed": false,
    "sortable": 'custom',
    "width": "150px",
    "type": "column"
  },
  {
    "label": i18n.t('task.components.displayName.currentTaskNumOfPlanTime') as string,
    "field": "plan",
    "show": true,
    "fixed": false,
    "sortable": 'custom',
    "width": "180px",
    "type": "column"
  },
  {
    "label": i18n.t('task.components.displayName.authorizedTaskType') as string,
    "field": "authorizedTaskType",
    "show": true,
    "fixed": false,
    "sortable": 'custom',
    "width": "150px",
    "type": "column"
  },
  {
    "label": i18n.t('task.components.displayName.authorizedProductType') as string,
    "field": "authorizedProductType",
    "show": true,
    "fixed": false,
    "sortable": 'custom',
    "width": "150px",
    "type": "column"
  },
  {
    "label": i18n.t('task.components.displayName.authorizedArea') as string,
    "field": "authorizedArea",
    "show": true,
    "fixed": false,
    "sortable": 'custom',
    "width": "150px",
    "type": "column"
  },
  {
    "label": i18n.t('common.form.type.serviceProviderQualification') as string,
    "field": "serviceProviderQualification",
    "show": true,
    "fixed": false,
    "sortable": 'custom',
    "width": "150px",
    "type": "column"
  },
  // 性别，上岗日期，工程师属性，授权有效期，角色，状态
  {
    "label": i18n.t('common.base.sex') as string,
    "field": "sex",
    "show": true,
    "fixed": false,
    "sortable": 'custom',
    "width": "150px",
    "type": "column"
  },
  {
    "label": i18n.t('common.form.type.engineerDate') as string,
    "field": "engineerDate",
    "show": true,
    "fixed": false,
    "sortable": 'custom',
    "width": "150px",
    "type": "column"
  },
  {
    "label": i18n.t('common.form.type.engineerAttribute') as string,
    "field": "engineerAttribute",
    "show": true,
    "fixed": false,
    "sortable": 'custom',
    "width": "150px",
    "type": "column"
  },
  {
    "label": i18n.t('common.base.validityOfAuthorization') as string,
    "field": "validTime",
    "show": true,
    "fixed": false,
    "sortable": 'custom',
    "width": "150px",
    "type": "column"
  },
  {
    "label": i18n.t('common.base.role') as string,
    "field": "role",
    "show": true,
    "fixed": false,
    "sortable": 'custom',
    "width": "150px",
    "type": "column"
  },
  {
    "label": i18n.t('common.base.status') as string,
    "field": "status",
    "show": true,
    "fixed": false,
    "sortable": 'custom',
    "width": "150px",
    "type": "column"
  },
]

/* 服务商 资质类型 */
export enum QualificationsEnum {
  // 工单资质
  TaskQualifications = 'taskTypeQualification',
  // 产品目录资质
  ProductQualifications = 'productQualifications',
  // 区域资质
  AreaQualifications = 'areaQualifications',
  // 服务商资质
  ServiceProviderQualification = 'serviceProviderQualification'
}


// 获取服务商列表的参数类型
export interface GetServiceProviderListParams {
  // 当前页
  pageNum: number;
  // 每页条数
  pageSize: number;
  taskTypeQualification?: string;
  productTypeQualification?:string[] | null;
  customerAreaQualification?:{};
  serviceProviderQualification?: string;
  providerNameLike?:string

}


export interface TaskAllotServiceProviderInfo {
  // 服务商id
  serviceProviderId?: string;
  // 服务商名称
  serviceProviderName?: string;
  // 产品资质
  serviceProviderQualification?: string[];
  // 用户id
  userId?: string;
  // 用户名称
  username?: string;
}

export enum TaskAllotServiceProviderEmitEventEnum {
  // 添加服务商
  SetServiceProvider = 'setServiceProvider',
  // 删除服务商
  DeleteServiceProvider = 'deleteServiceProvider',
  DeleteSynergyUser = 'deleteSynergyUser',
  SetSynergys = 'setSynergys',
  SetReason = 'setReason',
  SetCustomReason = 'setCustomReason',
  SetCustomerTags = 'setCustomerTags',
  SetAtUsers = 'setAtUsers'
}